package com.moly.virgo.test;

import java.io.*;

public class ExceptionT {

    public static void main(String[] args) {
//        String s=test1();
//        System.out.println("s ="+s);
        System.out.println(test5());
    }

    static String test5(){

        try {
            throw new Exception("");
        }catch (Exception e){
            e.printStackTrace();
            return "exception";
        }finally {
            return "finally";
        }
    }
    static void  test4() throws Exception {
        throw new Exception("");
    }
    static void test3()   {
        try {
            new BufferedWriter(new FileWriter(new File("")));
        } catch (IOException e) {
            e.printStackTrace();
            try {
                throw e;
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
    static void test2() throws IOException {
        new BufferedWriter(new FileWriter(new File("")));
    }
    static  String test1(){
        File file = new File("");
        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
            System.out.println(1);
            return "1";
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            System.out.println(2);
            return "2";
        }finally {
            System.out.println(3);
            return "3";
        }

    }
}
